//
// Created by liushuai on 2021/1/2.
//

#include "sum_n.h"
<<<<<<< HEAD:cxx/algorithm/src/sum_n.cc
void sum_n(int target,int begin,std::vector<int>& v){
    if(target == 0){
        for(auto i:v)
            std::cout<<i<<" ";
        std::cout<<"\n";
    }
    for(int i=begin;i<=target;i++){
        v.push_back(i);
        sum_n(target-i,i+1,v);
        v.pop_back();
    }
=======
void sum_n(int target, int begin, std::vector<int>& v) {
  if (target == 0) {
    for (auto i : v) std::cout << i << " ";
    std::cout << "\n";
  }
  for (int i = begin; i <= target; i++) {
    v.push_back(i);
    sum_n(target - i, i + 1, v);
    v.pop_back();
  }
>>>>>>> dev:cxx/algorithm/common/src/sum_n.cc
}